import {
	http,
	Method
} from '@/utils/request.js'
import api from '@/config/api.js'

/**
 * 店铺基本信息
 */
export function StoreInfo() {
	return http.request({
		url: `/store/get/detail`,
		method: Method.GET
	})
}

/**
 * 修改店铺信息
 */
export function StoreInfoUpdate(params) {
	return http.request({
		url: `/store/get/updateInfo`,
		method: Method.GET,
		params
	})
}

/**
 * 店铺订单基本信息
 */
export function StoreOrderList(params) {
	return http.request({
		url: `/store/orderList`,
		method: Method.GET,
		params
	})
}
/**
 * 店铺订单核销
 */
export function StoreOrderTake(sn, code) {
	return http.request({
		url: `/orders/take/${sn}/${code}`,
		method: Method.PUT
	})
}
/**
 * 商家钱包余额  销售钱包
 * @returns {AxiosPromise}
 */
export function getSaleWallet() {
	return http.request({
		url: "/members/wallet",
		method: Method.GET,
		needToken: true,
		params: {
			owner: 'SALE'
		}
	})
}
/**
 * 今日销售额
 */
export function StoreSaleMoney(params) {
	return http.request({
		url: `/store/getList`,
		method: Method.GET,
		params
	})
}
/**
 * 用户给商家付款  1.
 */
export function CreateOfflineTrade(params) {
	return http.request({
		url: `/trade/carts/create/offlineTrade`,
		method: Method.POST,
		data: params
	})
}
